home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / diag.frm < prev    next >
Text File  |  1995-05-07  |  5KB  |  148 lines

  1. VERSION 2.00
  2. Begin Form DiagForm 
  3.    Caption         =   "Diagnostics Services Test"
  4.    ClientHeight    =   1785
  5.    ClientLeft      =   2160
  6.    ClientTop       =   1575
  7.    ClientWidth     =   4680
  8.    Height          =   2190
  9.    Left            =   2100
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1785
  13.    ScaleWidth      =   4680
  14.    Top             =   1230
  15.    Width           =   4800
  16.    Begin CommandButton OKButton 
  17.       Caption         =   "&OK"
  18.       Height          =   372
  19.       Left            =   1920
  20.       TabIndex        =   0
  21.       Top             =   1320
  22.       Width           =   852
  23.    End
  24.    Begin Label shellVerLabel 
  25.       Height          =   255
  26.       Left            =   3600
  27.       TabIndex        =   3
  28.       Top             =   960
  29.       Width           =   855
  30.    End
  31.    Begin Label Label4 
  32.       Alignment       =   1  'Right Justify
  33.       Caption         =   "You are running NetWare shell version:"
  34.       Height          =   255
  35.       Left            =   120
  36.       TabIndex        =   7
  37.       Top             =   960
  38.       Width           =   3375
  39.    End
  40.    Begin Label SPXVerLabel 
  41.       Height          =   255
  42.       Left            =   3600
  43.       TabIndex        =   8
  44.       Top             =   720
  45.       Width           =   855
  46.    End
  47.    Begin Label Label3 
  48.       Alignment       =   1  'Right Justify
  49.       Caption         =   "You are running SPX version:"
  50.       Height          =   255
  51.       Left            =   840
  52.       TabIndex        =   6
  53.       Top             =   720
  54.       Width           =   2655
  55.    End
  56.    Begin Label IPXVerLabel 
  57.       Height          =   255
  58.       Left            =   3600
  59.       TabIndex        =   2
  60.       Top             =   480
  61.       Width           =   855
  62.    End
  63.    Begin Label Label2 
  64.       Alignment       =   1  'Right Justify
  65.       Caption         =   "You are running IPX version:"
  66.       Height          =   255
  67.       Left            =   840
  68.       TabIndex        =   5
  69.       Top             =   480
  70.       Width           =   2655
  71.    End
  72.    Begin Label connNumLabel 
  73.       Height          =   255
  74.       Left            =   3600
  75.       TabIndex        =   1
  76.       Top             =   240
  77.       Width           =   855
  78.    End
  79.    Begin Label Label1 
  80.       Alignment       =   1  'Right Justify
  81.       Caption         =   "You are at connection:"
  82.       Height          =   255
  83.       Left            =   1440
  84.       TabIndex        =   4
  85.       Top             =   240
  86.       Width           =   2055
  87.    End
  88. End
  89.  
  90. Sub Form_Load ()
  91.     Dim physNodeAddress As NodeAddress
  92.     Dim socketNum As Integer
  93.     Dim destination As BeginDiagnosticStruct
  94.     Dim compList As ComponentList
  95.     Dim response As AllResponseData
  96.     Dim ipxResponse As IPXSPXVersion
  97.     Dim shellResponse As ShellVersionStruct
  98.  
  99.     connNum& = GetConnectionNumber()
  100.     connNumLabel.Caption = Str$(connNum&)
  101.  
  102.     ccode% = GetInternetAddress(connNum&, networkNum&, physNodeAddress, socketNum)
  103.     If (ccode% <> SUCCESSFUL) Then
  104.         MsgBox "Unable to get your workstation's internetwork address", MB_OK, "Error"
  105.     Else
  106.         destination.network = networkNum&
  107.         'destination.nodeAddr = physNodeAddress
  108.         destination.nodeAddr.nodeHi = physNodeAddress.nodeHi
  109.         destination.nodeAddr.nodeLo = physNodeAddress.nodeLo
  110.         destination.socket = socketNum
  111.         ccode% = BeginDiagnostics(destination, connID%, compList)
  112.         
  113.         If (ccode% <> SUCCESSFUL) Then
  114.             MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  115.         Else
  116.             offset% = FindComponentOffset(compList, IPX_SPX_COMPONENT)
  117.             ccode% = GetIPXSPXVersion(connID%, offset%, response, ipxResponse)
  118.             If (ccode% = SUCCESSFUL) Then
  119.                 IPXVerLabel.Caption = Format$(Asc(ipxResponse.IPXMajorVersion)) + "." + Format$(Asc(ipxResponse.IPXMinorVersion))
  120.                 SPXVerLabel.Caption = Format$(Asc(ipxResponse.SPXMajorVersion)) + "." + Format$(Asc(ipxResponse.SPXMinorVersion))
  121.             
  122.                 offset% = FindComponentOffset(compList, SHELL_COMPONENT)
  123.                 ccode% = GetShellVersionInfo(connID%, offset%, response, shellResponse)
  124.                 If (ccode% = SUCCESSFUL) Then
  125.                     shellVerLabel.Caption = Format$(Asc(shellResponse.major)) + "." + Format$(Asc(shellResponse.minor)) + Chr$(Asc(shellResponse.rev) + 97)
  126.                 Else
  127.                     shellVerLabel.Caption = "Unknown"
  128.                 End If
  129.             
  130.                 ccode% = EndDiagnostics(connID%)
  131.                 If (ccode% <> SUCCESSFUL) Then
  132.                     MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  133.                 End If
  134.             Else
  135.                 MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  136.                 IPXVerLabel.Caption = "Unknown"
  137.                 SPXVerLabel.Caption = "Unknown"
  138.                 shellVerLabel.Caption = "Unknown"
  139.             End If
  140.         End If
  141.     End If
  142. End Sub
  143.  
  144. Sub OKButton_Click ()
  145.     Unload DiagForm
  146. End Sub
  147.  
  148.